package subject_set.offer100;

/**
 * @author haomin
 * @date 2022/10/21 20:35
 **/
public class Offer50 {
    class Solution {
        public char firstUniqChar(String s) {
            int[] arr = new int[26];
            for(int i = 0; i < s.length(); ++i){
                arr[s.charAt(i) - 'a']++;
            }
            for(int i = 0; i < s.length(); ++i){
                if(arr[(s.charAt(i)-'a')] == 1) return s.charAt(i);
            }
            return ' ';
        }
    }
}